<template>
<view v-if="show">
	<view class="loading-view-main">
		<view class="no-load-view">
			<!-- <view class="location-view"><view :animation="openAnimation" class="zsl-icons location-icon icon-weizhi1"></view></view> -->
			<view class="location-view"><image :src="loadImg()" mode="aspectFit"/></view>
			<view class="location-remind">{{text}}</view>
		</view>
	</view>
</view>
</template>

<script>
export default {
	props: {
		show: {
			type: Boolean, default: true
		},
		text: {
			type: String, default: "正在努力加载中..."
		}
	},
	methods: {
		loadImg: function() {
			/* const array = ["/static/loading-new.gif", "/static/loading1-new.gif", "/static/loading2-new.gif",
						"/static/loading3-new.gif", "/static/loading5-new.gif"]; */
			const array = ["/static/loading-new.gif","/static/loading3-new.gif"];
						
			const index = parseInt(Math.random()*array.length);
			// console.log("---------->",index);
			return array[index];
		}
	}
}
</script>

<style>
.loading-view-main {
	width: 100vw; height: 100vh; background: #FFF; opacity: 0.9;
	position: fixed; z-index: 999; left: 0rpx; right: 0rpx; float: left;
}
.location-view {
	text-align: center; padding: 200rpx 0rpx 100rpx 0rpx;
}
.location-view image {
	width: 25%;
}
.location-remind {
	text-align: center; color:#999;
}
</style>
